clear all
set mem 1000
cd "D:\data\origin\COVID19"
use internationaldata
egen id=group(countryorregion)
tsset id newdate	

//Fig. 1
	
	local cont "land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania " 
	local x "Individualism"	
	
	foreach v in `x' {
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ivregress 2sls confirmedcases vaccination vaccination_missing  test test_missing `cont' (`v'=nobel_prize), robust
	rename _eq2_stat_1 number
	replace number=number-26
	gen lower=_b_`v'-_se_`v'*invnormal(0.95)
	gen upper=_b_`v'+_se_`v'*invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower=_b_`v'-_se_`v'*invnormal(0.975)
	replace upper=_b_`v'+_se_`v'*invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	eclplot _b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Confirmed Cases)",size(medlarge)) yscale(range(0 0.8)) ylabel(0(0.2)0.8) xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(medium)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE1_1.gph", replace
	restore
	}
	
	local cont "land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania " 
	local x "Individualism"	

	foreach v in `x' {
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ivregress 2sls deaths vaccination vaccination_missing  test test_missing `cont' (`v'=nobel_prize), robust
	rename _eq2_stat_1 number
	replace number=number-26
	gen lower=_b_`v'-_se_`v'*invnormal(0.95)
	gen upper=_b_`v'+_se_`v'*invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower=_b_`v'-_se_`v'*invnormal(0.975)
	replace upper=_b_`v'+_se_`v'*invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	eclplot _b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Death Cases)",size(medlarge)) yscale(range(0 0.4)) ylabel(0(0.1)0.4) xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(medium)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE1_2.gph", replace
	restore
	}
		

	local cont "land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania " 
	local x "Individualism"	
	
	foreach v in `x' {
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ivregress 2sls deathratio vaccination vaccination_missing  test test_missing `cont' (`v'=nobel_prize), robust
	rename _eq2_stat_1 number
	replace number=number-25
	gen lower=_b_`v'-_se_`v'*invnormal(0.95)
	gen upper=_b_`v'+_se_`v'*invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower=_b_`v'-_se_`v'*invnormal(0.975)
	replace upper=_b_`v'+_se_`v'*invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	eclplot _b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Death Ratio)",size(medlarge)) yscale(range(-0.2 0.6))  xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(medsmall)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE1_3.gph", replace
	restore
	}
	

//Fig. 2

	local cont "confirmedcases vaccination vaccination_missing  test test_missing land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania"
	local x "Individualism"
	local size12 "yscale(range(-4 1)) ylabel(-4(1)1)"
    local size22 "yscale(range(-1 0.5)) ylabel(-1(0.5)0.5)"
    local size32 "yscale(range(-2 2)) ylabel(-2(1)2)"
    local size42 "yscale(range(-4 4)) ylabel(-4(2)4)"
    local size52 "yscale(range(-1 1.5)) ylabel(-1(0.5)1.5)"
    local size62 "yscale(range(-1 2)) ylabel(-1(1)2)"
    local size72 "yscale(range(-1 0.5)) ylabel(-1(0.5)0.5)"
    local size82 "yscale(range(-0.5 1)) ylabel(-0.5(0.5)1)"
			
	foreach v in `x' {
	gen c1s=schoolclosing
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c1s `v' `cont', robust
	gen lower= c1s_b_`v' - c1s_se_`v' *invnormal(0.95)
	gen upper= c1s_b_`v' + c1s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c1s_b_`v' - c1s_se_`v' *invnormal(0.975)
	replace upper= c1s_b_`v' + c1s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	replace c1s_b_`v'=. if c1s_b_`v'<-5
	replace lower=. if c1s_b_`v'==.
	replace upper=. if c1s_b_`v'==.
	save internationalresult\c1s,replace
	eclplot c1s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of School Closing)",size(medlarge)) `size12' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_1", replace
	restore
	}
		  
	foreach v in `x' {
	gen c2s=workplaceclosing
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c2s `v' `cont', robust
	gen lower= c2s_b_`v' - c2s_se_`v' *invnormal(0.95)
	gen upper= c2s_b_`v' + c2s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c2s_b_`v' - c2s_se_`v' *invnormal(0.975)
	replace upper= c2s_b_`v' + c2s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	save internationalresult\c2s,replace
	eclplot c2s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Workplace Closing)",size(medlarge)) `size22' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_2.gph", replace
	restore
	}
		  
	foreach v in `x' {
	gen c3s=cancellingpublicevents
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c3s `v' `cont', robust
	gen lower= c3s_b_`v' - c3s_se_`v' *invnormal(0.95)
	gen upper= c3s_b_`v' + c3s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c3s_b_`v' - c3s_se_`v' *invnormal(0.975)
	replace upper= c3s_b_`v' + c3s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	replace c3s_b_`v'=. if c3s_b_`v'>1.5 | c3s_b_`v'<-1
	replace lower=. if c3s_b_`v'==.
	replace upper=. if c3s_b_`v'==.	
	save internationalresult\c3s,replace
	eclplot c3s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Cancelling Public Events)",size(medlarge)) `size32' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_3.gph", replace
	restore
	}
		  
	foreach v in `x' {
	gen c4s=restrictionsongatherings
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c4s `v' `cont', robust
	gen lower= c4s_b_`v' - c4s_se_`v' *invnormal(0.95)
	gen upper= c4s_b_`v' + c4s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c4s_b_`v' - c4s_se_`v' *invnormal(0.975)
	replace upper= c4s_b_`v' + c4s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	replace c4s_b_`v'=. if c4s_b_`v'>10
	replace lower=. if c4s_b_`v'==.
	replace upper=. if c4s_b_`v'==.	
	save internationalresult\c4s,replace
	eclplot c4s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Restrictions on Gatherings)",size(medlarge)) `size42' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_4.gph", replace
	restore
	}
	  
	foreach v in `x' {
	gen c5s=transportclosure
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c5s `v' `cont', robust
	gen lower= c5s_b_`v' - c5s_se_`v' *invnormal(0.95)
	gen upper= c5s_b_`v' + c5s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c5s_b_`v' - c5s_se_`v' *invnormal(0.975)
	replace upper= c5s_b_`v' + c5s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	save internationalresult\c5s,replace
	eclplot c5s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Transport Closure)",size(medlarge)) `size52' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_5.gph", replace
	restore
	}
		  
	foreach v in `x' {
	gen c6s=stayathomerequirement
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c6s `v' `cont', robust
	gen lower= c6s_b_`v' - c6s_se_`v' *invnormal(0.95)
	gen upper= c6s_b_`v' + c6s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c6s_b_`v' - c6s_se_`v' *invnormal(0.975)
	replace upper= c6s_b_`v' + c6s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	save internationalresult\c6s,replace
	eclplot c6s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Stay-at-home Requirement)",size(medlarge)) `size62' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_6.gph", replace
	restore
	}
	
	foreach v in `x' {
	gen c7s=restrictionsoninternalmove 
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c7s `v' `cont', robust
	gen lower= c7s_b_`v' - c7s_se_`v' *invnormal(0.95)
	gen upper= c7s_b_`v' + c7s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c7s_b_`v' - c7s_se_`v' *invnormal(0.975)
	replace upper= c7s_b_`v' + c7s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	replace c7s_b_`v'=. if c7s_b_`v'<-1 | c7s_b_`v'>0.4
	replace lower=. if c7s_b_`v'==.
	replace upper=. if c7s_b_`v'==.	
	save internationalresult\c7s,replace
	eclplot c7s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of Restrictions on Internal Movement)",size(medsmall)) `size72' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_7.gph", replace
	restore
	}
	
	foreach v in `x' {
	gen c8s=internationaltravelcontrols
	preserve
	sort newdate
	statsby _b _se e(N), by(newdate) clear: ologit c8s `v' `cont', robust
	gen lower= c8s_b_`v' - c8s_se_`v' *invnormal(0.95)
	gen upper= c8s_b_`v' + c8s_se_`v' *invnormal(0.95)
	drop if newdate<20200101 | newdate>20211231
	sort newdate
	gen id=_n
	gen plotgroup= "2"
	save temp1,replace
	replace lower= c8s_b_`v' - c8s_se_`v' *invnormal(0.975)
	replace upper= c8s_b_`v' + c8s_se_`v' *invnormal(0.975)
	replace plotgroup= "1"
	save temp2,replace
	append using temp1
	save internationalresult\c8s,replace
	eclplot c8s_b_`v' lower upper id, estopts( msize(vsmall)) ytitle("Coefficient (Regression of International Travel Controls)",size(medium)) `size82' xtitle("") title("`v'",size(huge)) xlabel(15 "Jan 2020"  197"Jul 2020" 381"Jan 2021" 562 "Jul 2021" 715 "Dec 2021" , labsize(small)) ylab(,labsize(medlarge)) graphregion(color(white)) supby(plotgroup) ciopts1(blcolor(eltblue)) ciopts2(blcolor("78 155 235")) legend(off) yline(0, lcolor(red) lwidth(medthick))
	graph save "internationalresult\FIGURE2_8.gph", replace
	restore
	}

	
	
//Table 1

	//First Stage Regression Results (NOTE: please use STATA 13 to run the command ivregress2 )
	
	local ivlist "nobel_prize" 
	local datelist "20200415 20201015 20210415 20211015"
	local y "confirmedcases" 
	local x "Individualism" 
	local cont "land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania"
	
	foreach iv in `ivlist'	{	
	eststo clear
	foreach i in `y' {
	foreach v in `x' {
	foreach date in `datelist'{
		//NOTE: please use STATA 13 to run the command ivregress2 
	eststo: qui: ivregress2 2sls `i' vaccination vaccination_missing  test test_missing `cont' (`v'=`iv') if newdate==`date',first  robust
	est restore first
	outreg2 using internationalresult/TABLE1_1.xls,append ctitle(`date') sortvar(nobel_prize) bd(3) td(2) rd(3) tstat adjr2 excel
	}
	}
	}
}			
	
	//to get the First Stage Statistics
	
	local datelist "20200415 20201015 20210415 20211015"
	foreach date in `datelist'{
	ivreg2  confirmedcases vaccination vaccination_missing  test test_missing land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania (Individualism=nobel_prize) if newdate==`date' , partial(africa europe north_america south_america oceania) robust
	ivregress 2sls confirmedcases vaccination vaccination_missing  test test_missing land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania (Individualism=nobel_prize) if newdate==`date' , robust
	estat firststage,all forcenonrobust
	}
	
	//Second Stage Regression Results
	
	local ivlist "nobel_prize" 
	local datelist "20200415 20201015 20210415 20211015"
	local y "confirmedcases deaths deathratio" 
	local x "Individualism" 
	local cont "land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience relativeday relativeday_2 africa europe north_america south_america oceania"
	
	foreach iv in `ivlist'	{
	foreach i in `y' {
	eststo clear
	foreach dt in `datelist' {
	foreach v in `x' {
	eststo: qui: ivregress 2sls `i' vaccination vaccination_missing  test test_missing `cont' (`v'=`iv') if newdate==`dt' , robust
	}
	}
	esttab est* using internationalresult\TABLE1_2.csv, append cells("b(star label(Coef.) fmt(3))" t(par(( )) fmt(2))) nodepvars mtitles(`datelist')  ///
	starlevels(* 0.1 ** 0.05 *** 0.01) drop(_cons) label legend title(`i') nogaps order(Individualism)
	}
	}

		
	
	
//Table 2

	local didy "confirmedcases deaths deathratio" 
	local didxl "lowIndividualism"	
	local didsort "lowind_schoolclosing schoolclosing lowind_workplaceclosing workplaceclosing lowind_cancellingpublicevents  cancellingpublicevents lowind_restrictionsongatherings restrictionsongatherings  lowind_transportclosure transportclosure lowind_stayathomerequirement stayathomerequirement lowind_internalmove restrictionsoninternalmove lowind_internationaltravel        internationaltravelcontrols"

	foreach dy in `didy' {
	foreach dxl in `didxl' {
	qui:xtreg  `dy' lowind_schoolclosing schoolclosing relativeday relativeday_2  test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_workplaceclosing workplaceclosing relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_cancellingpublicevents cancellingpublicevents relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_restrictionsongatherings restrictionsongatherings relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_transportclosure transportclosure relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_stayathomerequirement stayathomerequirement relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_internalmove restrictionsoninternalmove relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	qui:xtreg  `dy' lowind_internationaltravel internationaltravelcontrols relativeday relativeday_2 test test_missing vaccination vaccination_missing  , fe robust
	outreg2 using internationalresult/TABLE2_`dy'.xls,append  bd(3) td(2) rd(3) tstat adjr2 excel sortvar(`didsort')
	}
	}
	
	
	
//SUPPLEMENTAL TABLE 2

	local datelist "20200415 20201015 20210415 20211015"
	foreach date in `datelist'{
	eststo clear
	eststo: qui estpost tabstat confirmedcases confirmedcases_unlogged deaths deaths_unlogged test test_unlogged test_missing vaccination  vaccination_unlogged vaccination_missing deathratio relativeday relativeday_2 schoolclosing workplaceclosing cancellingpublicevents restrictionsongatherings transportclosure stayathomerequirement restrictionsoninternalmove internationaltravelcontrols if newdate==`date'  , statistics(n mean sd p10 p25 p50 p75 p90) columns(statistics)
	esttab est* using internationalresult/TABLES2_1.csv, append  cells("count(lab(N)) mean(fmt(2)) sd(fmt(2)) p10(fmt(2)) p25(fmt(2)) p50(fmt(2)) p75(fmt(2)) p90(fmt(2))")  nostar nonumbers noobs label unstack title(`date') 
	}
	
	eststo clear
	eststo: qui estpost tabstat  Individualism if newdate==20200415 , statistics(n mean sd p10 p25 p50 p75 p90) columns(statistics)	
	esttab est* using internationalresult/TABLES2_2.csv, append  cells("count(lab(N)) mean(fmt(2)) sd(fmt(2)) p10(fmt(2)) p25(fmt(2)) p50(fmt(2)) p75(fmt(2)) p90(fmt(2))")  nostar nonumbers noobs label unstack title(Country characteristics) 
	eststo clear
	eststo: qui estpost tabstat  land_area population_age65 gdp_growth export consumption alcohol arrival refugee internet broadband uhc healthsecurity directflight_wh sars_experience nobel_prize nobel_prize_lp if newdate==20200415 & withcontrols==1, statistics(n mean sd p10 p25 p50 p75 p90) columns(statistics)	
	esttab est* using internationalresult/TABLES2_2.csv, append  cells("count(lab(N)) mean(fmt(2)) sd(fmt(2)) p10(fmt(2)) p25(fmt(2)) p50(fmt(2)) p75(fmt(2)) p90(fmt(2))")  nostar nonumbers noobs label unstack 
		